package com.opages.mvc.example.controller;

import com.opages.mvc.example.api.MvcExampleApi;
import com.opages.mvc.example.model.MvcExampleDto;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MvcExampleController implements MvcExampleApi {
//	@Autowired
//	private AutoConfiguration configuration;
	@Override
	public MvcExampleDto getExample(@RequestParam("id") Integer id) {
//		String config = configuration.getConfig();
		System.err.println("id="+id);
		MvcExampleDto dto = new MvcExampleDto();
		dto.setId(id);
		dto.setUsername("xiaomin");
		dto.setPassword("123456");
		return dto;
	}

	@Override
	public void save(@RequestBody MvcExampleDto demoDto) {
		System.err.println("MVC Example保存-->"+demoDto.toString());
	}
}
